package demo1;

class Pat extends Thread{
    @Override
    public void run() {
        while(true){
            System.out.println("hello word");
            try{
                Thread.sleep(1000);
            }catch(InterruptedException e){
                e.printStackTrace();
            }
        }
    }
}

public class DEMO {
    public static  void main(String[] args) throws InterruptedException {
        Pat t=new Pat();
        t.start();
        while(true){
            System.out.println("t");
            Thread.sleep(1000);
        }
    }
}
